$(document).ready(function() {
// 在键盘按下并释放及提交后验证提交表单
// 管理员表单
  $("#form").validate({
	    rules: 
	    {
		      user: //账户
		      {
		        required: true,
		        minlength: 6
//		        remote:"check.php"
		      },
		      password: //密码
		      {
		        required: true,
		        minlength: 6
		      },
		      password2: //密码
		      {
		        required: true,
		        minlength: 6
		      },
		      userName: //姓名
		      {
		      	required: true,
		        maxlength: 4
		      },
		      authority: //特权码
		      {
		      	required: true
//		      	remote:"check.php"
		      }	   
	    },
	    messages: 
	    {
	    	user: //账户
		    {
		       required:"此为必填字段",
		       minlength: "账户至少由6个字符组成"
//		       remote:"此账户已存在"
		    },
		    password: //密码
		    {
		       required:"此为必填字段",
		       minlength:"密码至少由6个字符组成"
		    },
		    password2: //密码
		    {
		       required:"此为必填字段",
		       minlength:"密码至少由6个字符组成"
		    },
		    userName: //姓名
		    {
		    	required:"此为必填字段",
		       minlength: "姓名至多由4个字符组成，请选择实名注册"
		    },
		    authority: //特权码
		    {
		    	required:"此为必填字段"
//		    	remote:"特权码错误"
		    }	   
		}
	});
  
});